package com.kuangjia.student_ems.service;

import com.kuangjia.student_ems.dto.SalaryRecordDTO;
import com.kuangjia.student_ems.dto.SalarySchemeDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

public interface SalaryService {
    
    // 薪资方案管理
    List<SalarySchemeDTO> getAllSalarySchemes();
    
    SalarySchemeDTO getSalarySchemeById(Long id);
    
    SalarySchemeDTO createSalaryScheme(SalarySchemeDTO schemeDTO);
    
    SalarySchemeDTO updateSalaryScheme(Long id, SalarySchemeDTO schemeDTO);
    
    void deleteSalaryScheme(Long id);
    
    // 薪资记录管理
    IPage<SalaryRecordDTO> getSalaryRecords(Page<SalaryRecordDTO> page, Integer year, Integer month, String status, Long userId);
    
    SalaryRecordDTO getSalaryRecordById(Long id, org.springframework.security.core.Authentication authentication);
    
    // 薪资核算
    Map<String, Object> calculateSalary(Integer year, Integer month);
    
    SalaryRecordDTO calculateUserSalary(Long userId, Integer year, Integer month);
    
    // 薪资确认和发放
    SalaryRecordDTO confirmSalary(Long id);
    
    SalaryRecordDTO paySalary(Long id);
    
    // 批量操作
    Map<String, Object> batchConfirmSalary(Integer year, Integer month);
    
    Map<String, Object> batchPaySalary(Integer year, Integer month);
    
    // 薪资统计
    Map<String, Object> getSalaryStatistics(Integer year, Integer month);
    
    Map<String, Object> batchGenerateSalaryRecords(Integer year, Integer month);
    
    Map<String, Object> batchDeleteSalaryRecords(Integer year, Integer month);
    
    void confirmSalaryByUser(Long recordId, Long userId);
    
    /**
     * 员工变更自己薪资记录的状态（如确认、发放）
     */
    boolean updateSalaryStatus(Long salaryRecordId, String status, Long userId);
} 